home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -screenplay- / hd_installers / whdidemos / spaceballs_stateoftheart.lha / State Of The Art / Install next >
Text File  |  1998-07-09  |  3KB  |  162 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README") ;name of readme file
  4. (set #last-disk 1)          ;amount of disks
  5.  
  6. ;****************************
  7. ;----------------------------
  8. ; Checks if given program is reachable via the path
  9. ; if not abort install
  10. ; IN:  #program - to check
  11. ; OUT: -
  12.  
  13. (procedure P_chkrun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  18.   )
  19. )
  20.  
  21. ;----------------------------
  22. ; Create disk-Image using DIC
  23. ; IN:  #dest        - DestinationPath
  24. ;      #CI_diskname - DiskName
  25. ;      #CI_diskno   - DiskNumber
  26. ;      #CI_drive    - DriveToReadFrom
  27. ; OUT: -
  28.  
  29. (procedure P_image
  30.   (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not checked)" #CI_diskname #CI_drive))
  31.   (if
  32.     (= 0 (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld >con:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno)))
  33.     ("")
  34.     (abort "\"DIC\" has failed to create a diskimage")
  35.   )
  36. )
  37.  
  38. ;****************************
  39.  
  40. (set #program "WHDLoad")
  41. (P_chkrun)
  42.  
  43. (set #program "DIC")
  44. (P_chkrun)
  45.  
  46. ; in expert mode ask for source drive
  47. (if
  48.   (= @user-level 2)
  49.   (
  50.     (set #CI_drive
  51.       (askchoice
  52.     (prompt "Select source drive for diskimages")
  53.     (default 0)
  54.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  55.     (help @askchoice-help)
  56.       )
  57.     )
  58.     (if
  59.       (= #CI_drive 0)
  60.       (set #CI_drive "DF0:")
  61.     )
  62.     (if
  63.       (= #CI_drive 1)
  64.       (set #CI_drive "DF1:")
  65.     )
  66.     (if
  67.       (= #CI_drive 2)
  68.       (set #CI_drive "RAD:")
  69.     )
  70.     (if
  71.       (= #CI_drive 3)
  72.       (set #CI_drive
  73.         (askstring
  74.           (prompt "Select source drive for diskimages")
  75.           (default "DF0:")
  76.           (help @askstring-help)
  77.         )
  78.       )
  79.     )
  80.   )
  81.   (
  82.     (set #CI_drive "DF0:")
  83.   )
  84. )
  85.  
  86. (set @default-dest
  87.   (askdir
  88.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  89.     (help @askdir-help)
  90.     (default @default-dest)
  91.     (disk)
  92.   )
  93. )
  94. (set #dest (tackon @default-dest @app-name))
  95. (if
  96.   (exists #dest)
  97.   (
  98.     (set #choice
  99.       (askbool
  100.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  101.         (default 1)
  102.         (choices "Delete" "Skip")
  103.         (help @askbool-help)
  104.       )
  105.     )
  106.     (if
  107.       (= #choice 1)
  108.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  109.     )
  110.   )
  111. )
  112. (makedir #dest
  113.   (help @makedir-help)
  114.   (infos)
  115. )
  116.  
  117. ;----------------------------
  118.  
  119. (copyfiles
  120.   (help @copyfiles-help)
  121.   (source ("%s.slave" @app-name))
  122.   (dest #dest)
  123. )
  124. (copyfiles
  125.   (help @copyfiles-help)
  126.   (source ("%s.inf" @app-name ))
  127.   (newname ("%s.info" @app-name ))
  128.   (dest #dest)
  129. )
  130. (if
  131.   (exists #readme-file)
  132.   (copyfiles
  133.     (help @copyfiles-help)
  134.     (source #readme-file)
  135.     (dest #dest)
  136.   )
  137. )
  138.  
  139. (set #CI_diskno 1)
  140. (while
  141.   (<= #CI_diskno #last-disk)
  142.   (
  143.     (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  144.     (P_image)
  145.     (set #CI_diskno (+ #CI_diskno 1))
  146.   )
  147. )
  148.  
  149. ;----------------------------
  150.  
  151. (if
  152.   (exists #readme-file)
  153.   (if
  154.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  155.     ("")
  156.     (run ("SYS:Utilities/More %s" #readme-file))
  157.   )
  158. )
  159.  
  160. (exit)
  161.  
  162.